package com.torry.edss.domain.accessor.impl;

import com.torry.edss.domain.valueobject.LimitType;
import com.torry.edss.infras.entity.TacticCrossStarSnipeDO;
import com.torry.edss.domain.model.TacticCrossStarSnipe;
import com.torry.edss.infras.mapper.TacticCrossStarSnipeMapper;
import com.torry.edss.domain.accessor.TacticCrossStarSnipeAccessor;
import org.springframework.stereotype.Service;
import com.torry.boot.starter.mybatisplus.service.AccessorImpl;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author torry.wang
 * @since 2025-05-11
 */
@Service
@SuppressWarnings("DuplicatedCode")
public class TacticCrossStarSnipeAccessorImpl extends AccessorImpl<TacticCrossStarSnipeMapper, TacticCrossStarSnipeDO, TacticCrossStarSnipe> implements TacticCrossStarSnipeAccessor {
    @Override
    public TacticCrossStarSnipe toModel(TacticCrossStarSnipeDO entity) {
        if (entity == null) return null;
        TacticCrossStarSnipe tacticCrossStarSnipe = new TacticCrossStarSnipe();
        tacticCrossStarSnipe.setCompanyId(entity.getCompanyId());
        tacticCrossStarSnipe.setLimitId(entity.getLimitId());
        tacticCrossStarSnipe.setLimitType(LimitType.parse(entity.getLimitType()));
        tacticCrossStarSnipe.setDate(entity.getDate());
        tacticCrossStarSnipe.setGuardPrice(entity.getGuardPrice());
        tacticCrossStarSnipe.setPurchaseDayClosePrice(entity.getPurchaseDayClosePrice());
        tacticCrossStarSnipe.setPurchaseDayOpenPrice(entity.getPurchaseDayOpenPrice());
        tacticCrossStarSnipe.setPurchaseDayMaxPrice(entity.getPurchaseDayMaxPrice());
        tacticCrossStarSnipe.setPurchaseDayMinPrice(entity.getPurchaseDayMinPrice());
        tacticCrossStarSnipe.setPurchaseDayOpenUpRatio(entity.getPurchaseDayOpenUpRatio());
        tacticCrossStarSnipe.setPurchaseDayCloseUpRatio(entity.getPurchaseDayCloseUpRatio());
        tacticCrossStarSnipe.setPurchaseDayMaxUpRatio(entity.getPurchaseDayMaxUpRatio());
        tacticCrossStarSnipe.setPurchaseDayMinUpRatio(entity.getPurchaseDayMinUpRatio());
        tacticCrossStarSnipe.setPurchaseDayQuantity(entity.getPurchaseDayQuantity());
        tacticCrossStarSnipe.setPreviousDayOpenPrice(entity.getPreviousDayOpenPrice());
        tacticCrossStarSnipe.setPreviousDayClosePrice(entity.getPreviousDayClosePrice());
        tacticCrossStarSnipe.setPreviousDayMaxPrice(entity.getPreviousDayMaxPrice());
        tacticCrossStarSnipe.setPreviousDayMinPrice(entity.getPreviousDayMinPrice());
        tacticCrossStarSnipe.setPreviousDayOpenUpRatio(entity.getPreviousDayOpenUpRatio());
        tacticCrossStarSnipe.setPreviousDayCloseUpRatio(entity.getPreviousDayCloseUpRatio());
        tacticCrossStarSnipe.setPreviousDayMaxUpRatio(entity.getPreviousDayMaxUpRatio());
        tacticCrossStarSnipe.setPreviousDayMinUpRatio(entity.getPreviousDayMinUpRatio());
        tacticCrossStarSnipe.setPreviousDayQuantity(entity.getPreviousDayQuantity());
        tacticCrossStarSnipe.setMaxProfitPrice(entity.getMaxProfitPrice());
        tacticCrossStarSnipe.setMaxProfitRatio(entity.getMaxProfitRatio());
        tacticCrossStarSnipe.setMaxLossPrice(entity.getMaxLossPrice());
        tacticCrossStarSnipe.setMaxLossRatio(entity.getMaxLossRatio());
        tacticCrossStarSnipe.setFirstAdjustQuantity(entity.getFirstAdjustQuantity());
        tacticCrossStarSnipe.setAdjustDays(entity.getAdjustDays());
        tacticCrossStarSnipe.setId(entity.getId());
        tacticCrossStarSnipe.setCreateTime(entity.getCreateTime());
        tacticCrossStarSnipe.setUpdateTime(entity.getUpdateTime());
        tacticCrossStarSnipe.setExtInfo(entity.getExtInfo());
        tacticCrossStarSnipe.setMaxProfitPriceTenDays(entity.getMaxProfitPriceTenDays());
        tacticCrossStarSnipe.setMaxProfitRatioTenDays(entity.getMaxProfitRatioTenDays());
        tacticCrossStarSnipe.setMaxLossPriceTenDays(entity.getMaxLossPriceTenDays());
        tacticCrossStarSnipe.setMaxLossRatioTenDays(entity.getMaxLossRatioTenDays());
        tacticCrossStarSnipe.setMaxProfitPriceNextDay(entity.getMaxProfitPriceNextDay());
        tacticCrossStarSnipe.setMaxProfitRatioNextDay(entity.getMaxProfitRatioNextDay());
        tacticCrossStarSnipe.setMaxLossPriceNextDay(entity.getMaxLossPriceNextDay());
        tacticCrossStarSnipe.setMaxLossRatioNextDay(entity.getMaxLossRatioNextDay());
        return tacticCrossStarSnipe;
    }

    @Override
    public TacticCrossStarSnipeDO toEntity(TacticCrossStarSnipe model) {
        if (model == null) return null;
        TacticCrossStarSnipeDO tacticCrossStarSnipeDO = new TacticCrossStarSnipeDO();
        tacticCrossStarSnipeDO.setCompanyId(model.getCompanyId());
        tacticCrossStarSnipeDO.setLimitId(model.getLimitId());
        tacticCrossStarSnipeDO.setLimitType(model.getLimitType() == null ? null : model.getLimitType().getCode());
        tacticCrossStarSnipeDO.setDate(model.getDate());
        tacticCrossStarSnipeDO.setGuardPrice(model.getGuardPrice());
        tacticCrossStarSnipeDO.setPurchaseDayClosePrice(model.getPurchaseDayClosePrice());
        tacticCrossStarSnipeDO.setPurchaseDayOpenPrice(model.getPurchaseDayOpenPrice());
        tacticCrossStarSnipeDO.setPurchaseDayMaxPrice(model.getPurchaseDayMaxPrice());
        tacticCrossStarSnipeDO.setPurchaseDayMinPrice(model.getPurchaseDayMinPrice());
        tacticCrossStarSnipeDO.setPurchaseDayOpenUpRatio(model.getPurchaseDayOpenUpRatio());
        tacticCrossStarSnipeDO.setPurchaseDayCloseUpRatio(model.getPurchaseDayCloseUpRatio());
        tacticCrossStarSnipeDO.setPurchaseDayMaxUpRatio(model.getPurchaseDayMaxUpRatio());
        tacticCrossStarSnipeDO.setPurchaseDayMinUpRatio(model.getPurchaseDayMinUpRatio());
        tacticCrossStarSnipeDO.setPurchaseDayQuantity(model.getPurchaseDayQuantity());
        tacticCrossStarSnipeDO.setPreviousDayOpenPrice(model.getPreviousDayOpenPrice());
        tacticCrossStarSnipeDO.setPreviousDayClosePrice(model.getPreviousDayClosePrice());
        tacticCrossStarSnipeDO.setPreviousDayMaxPrice(model.getPreviousDayMaxPrice());
        tacticCrossStarSnipeDO.setPreviousDayMinPrice(model.getPreviousDayMinPrice());
        tacticCrossStarSnipeDO.setPreviousDayOpenUpRatio(model.getPreviousDayOpenUpRatio());
        tacticCrossStarSnipeDO.setPreviousDayCloseUpRatio(model.getPreviousDayCloseUpRatio());
        tacticCrossStarSnipeDO.setPreviousDayMaxUpRatio(model.getPreviousDayMaxUpRatio());
        tacticCrossStarSnipeDO.setPreviousDayMinUpRatio(model.getPreviousDayMinUpRatio());
        tacticCrossStarSnipeDO.setPreviousDayQuantity(model.getPreviousDayQuantity());
        tacticCrossStarSnipeDO.setMaxProfitPrice(model.getMaxProfitPrice());
        tacticCrossStarSnipeDO.setMaxProfitRatio(model.getMaxProfitRatio());
        tacticCrossStarSnipeDO.setMaxLossPrice(model.getMaxLossPrice());
        tacticCrossStarSnipeDO.setMaxLossRatio(model.getMaxLossRatio());
        tacticCrossStarSnipeDO.setFirstAdjustQuantity(model.getFirstAdjustQuantity());
        tacticCrossStarSnipeDO.setAdjustDays(model.getAdjustDays());
        tacticCrossStarSnipeDO.setId(model.getId());
        tacticCrossStarSnipeDO.setCreateTime(model.getCreateTime());
        tacticCrossStarSnipeDO.setUpdateTime(model.getUpdateTime());
        tacticCrossStarSnipeDO.setExtInfo(model.getExtInfo());
        tacticCrossStarSnipeDO.setMaxProfitPriceTenDays(model.getMaxProfitPriceTenDays());
        tacticCrossStarSnipeDO.setMaxProfitRatioTenDays(model.getMaxProfitRatioTenDays());
        tacticCrossStarSnipeDO.setMaxLossPriceTenDays(model.getMaxLossPriceTenDays());
        tacticCrossStarSnipeDO.setMaxLossRatioTenDays(model.getMaxLossRatioTenDays());
        tacticCrossStarSnipeDO.setMaxProfitPriceNextDay(model.getMaxProfitPriceNextDay());
        tacticCrossStarSnipeDO.setMaxProfitRatioNextDay(model.getMaxProfitRatioNextDay());
        tacticCrossStarSnipeDO.setMaxLossPriceNextDay(model.getMaxLossPriceNextDay());
        tacticCrossStarSnipeDO.setMaxLossRatioNextDay(model.getMaxLossRatioNextDay());
        return tacticCrossStarSnipeDO;
    }
}
